//
//  Brand_Explore_VC_WX.m
//  ZITHER
//
//  Created by weixin on 2019/5/17.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Brand_Explore_VC_WX.h"
#import "Brand_Explore_Tbv_WX.h"
#import "createHotLabelModel.h"
#import "goodsBrandMyFollowModel.h"




@interface Brand_Explore_VC_WX ()
@property (nonatomic,strong)Brand_Explore_Tbv_WX * tbv;
@end

@implementation Brand_Explore_VC_WX

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNav];
    [self setMasonry];
    [self loadData];
}

-(void)setNav{
    [self.baseNavigationView NavigationBarStyle:1];
    self.baseNavigationView.leftButton1.hidden = YES;
    self.baseNavigationView.navViewStyle.title.text = @"探索";
    [self.baseNavigationView setHiddenNav:NO VC:self];
}

-(void)setMasonry{
    
    [self.view addSubview:self.tbv];
    [self.tbv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view).offset(0);
        make.top.equalTo(self.view).offset(NaviHeight);
    }];
}

-(Brand_Explore_Tbv_WX *)tbv{
    if (!_tbv) {
        _tbv = [[Brand_Explore_Tbv_WX alloc]initializeFrame:CGRectZero isMj:0 isEstimatedRowHeight:YES addRegisterNib:@[@"Brand_ExploreRecommend_Cell_WX",@"Brand_ExploreAttention_Cell_WX"]];
    }
    return _tbv;
}

-(void)loadData{
    [self rac_liftSelector:@selector(updateUIWithOneData:TwoData:) withSignalsFromArray:@[[serviceDefualt loadgoodsBrandMyFollow:[goodsBrandMyFollowModel class]],[serviceDefualt loadcreateHotLabel:[createHotLabelModel class]]]];
}

- (void)updateUIWithOneData:(ResponseData * )oneData TwoData:(ResponseData * )twoData {
    
    //拿到数据更新UI
    if (oneData.success) {
        self.tbv.BFModel = oneData.responseData;
    }
    if (twoData.success) {
        self.tbv.HLMode = twoData.responseData;
    }
    [self.tbv reloadData];
    
}


@end
